 var result_ysy = "<style>"+
"ul,"+
"fieldset,"+
"input,"+
"textarea,"+
"p,"+
"blockquote,"+
"th,"+
"td {"+
"	margin: 0;"+
"	padding: 0;"+
"}"+
".footerTop {"+
"	position: relative;"+
"}"+
".diban{"+
"	border-top: 1px solid rgba(166, 166, 166, 0.5);"+
"	position: absolute;"+
"	width: 100vw;"+
"	height: 15.574vw;"+
"	bottom: -2vw;"+
"	background: white;"+
"}"+
".footer2 {"+
"	position: fixed;"+
"	z-index: 1000;"+
"	bottom: 0vw;"+
"	width: 100vw;"+
"	height: 17.87vw;"+
"}"+
""+
".border_top {"+
	"width: 100%;"+
	"height: 100%;"+
	"z-index: 1001;"+
"}"+
""+
".border_top img {"+
"	width: 100%;"+
"}"+
""+
".menu_nav {"+
"	width: 100%;"+
"	height: 100%;"+
"	list-style: none;"+
"	display: flex;"+
"	justify-content: space-around;"+
"	z-index: 1002;"+
"	position: absolute;"+
"	top: 0vw;"+
"	left: 0vw;"+
"	padding-inline-start: 0px;"+
"}"+
""+
".menu_nav li {"+
"	text-align: center;"+
"	width: 15.5vw;"+
"	height: 10.37vw;"+
"}"+
""+
".menu_nav>li span {"+
"	display: block;"+
"	font-size: 3.06vw;"+
"	margin-top: 0.9vw;"+
"}"+
""+
".menu_img {"+
"	width: 15.56vw;"+
"	height: 5.56vw;"+
"}"+
""+
".menu_img img {"+
"	height: 100%;"+
"}"+
""+
"#menu_1,"+
"#menu_2,"+
"#menu_3,"+
"#menu_4,"+
"#menu_5 {"+
"	margin-top: 6vw;"+
"}"+
""+
""+
"</style>"+
"<div class='footerTop'>"+
"					<div class='footer2'>"+
"						<div class='diban'>"+
"						</div>"+
"						<ul class='menu_nav'>"+
"						</ul>"+
"					</div>"+
"			</div>";
 $(function () {
//	var u = navigator.userAgent;
//	var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
//	var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
//	//if (browser.versions.iPhone || browser.versions.iPad || browser.versions.ios) {
//	if(isiOS) {
////		$("div").css("cursor", "pointer");
//	}
//	//if (browser.versions.android) {
//	if(isAndroid) {
//		console.log("我是安卓系统");
//	}
	baseInfo();
	jiazaidaohang();
	
	
});
var menu_img_url1=new Array();
var menu_img_url2=new Array();
var menu_name = new Array();
var length = 0;
var index = 0;

window.onload=function(){
	jiazaineirong();
	jiazaishijian();
	
}
function baseInfo(){
	var daohang_dibu = $(".footerMenu_ysy ul");
	var size = daohang_dibu.children().length;
	length = size;
	for(var i=0;i<size;i++){
		var li = daohang_dibu.children().eq(i);
		var menuimgurl1 = li.children().eq(0).attr("src");
		var menuimgurl2 = li.children().eq(1).attr("src");
		var name = li.children().eq(2).text();
		if(name.indexOf("ysy")!=-1){
			name = name.replace("ysy","");
			index = i;
		}
		//	/获取变色前的图
		menu_img_url1[i] = menuimgurl1;
		//获取变色后的图
		menu_img_url2[i] = menuimgurl2;
		//获取对应的菜单名称
		menu_name[i] = name;
	}
}

//加载导航
function jiazaidaohang() {
	var daohang_dibu = $(".footerMenu_ysy");
	daohang_dibu.html("");
//	$.ajax({
//					url: "./../../../static/daohang.html",
////					url:"D:/myinstallsoft/HBuilder/workspace/inquirylearning/static/daohang.html",
//					type: "get",
//					success: function(result) {
////						console.log(result); //正则表达式获取body块        var reg = /[\s\S]*<\/body>/g;        var html = reg.exec(result)[0];        //然后用filter来筛选对应块对象，如：class='aa'        var aa = $(html).filter(".aa");        var aahtml = aa.html();        console.log(aahtml);        //获取内容后可以插入当前html中。。。    }});
//						daohang_dibu.html(result);
//					}
//	});
	daohang_dibu.html(result_ysy);
}
function jiazaineirong(){
	//
	var content = "";
	$(".footerMenu_ysy ul").html("");
	for(var i=0;i<length;i++){
		var text = "";
		//判定是否为默认按钮
		if(i==index){
		text = "<li id='menu_"+(i+1)+"'>"+
					"	<div class='menu_img'>"+
					"		<img alt='' src='url_ysy_XX'/>"+
					"	</div>"+
					"	<span style='color: #faac14'>neirong_ysy_xx</span>"+
					"</li>";
			text = text.replace("url_ysy_XX",menu_img_url2[i]);
			
		}else{
			text = "<li id='menu_"+(i+1)+"'>"+
					"	<div class='menu_img'>"+
					"		<img alt='' src='url_ysy_XX'/>"+
					"	</div>"+
					"	<span style='color: #999999'>neirong_ysy_xx</span>"+
					"</li>";
			text = text.replace("url_ysy_XX",menu_img_url1[i]);
		}
		text = text.replace("neirong_ysy_xx",menu_name[i])
		content += text;
	}
//	console.log(content);
	$(".footerMenu_ysy ul").append(content);
}
function jiazaishijian(){
	for(var i=0;i<length;i++){
		$('body').on('click','#menu_'+(i+1),menu_ysy);
	}
	//	$("body").on("click","#menu_2",menu_ysy);
	//	$("body").on("click","#menu_3",menu_ysy);
	//	$("body").on("click","#menu_4",menu_ysy);
	//	$("body").on("click","#menu_5",menu_ysy);
}
function menu_ysy(){
	var obj = this;
	/*把四格图标换成灰色*/
	for(var i=0;i<length;i++){
		$("#menu_"+(i+1)+" div img").attr("src",menu_img_url1[i]);
		$("#menu_"+(i+1)+" span").css("color","#999999");
	}
	var index1 = $(obj).attr("id").split("_")[1];
	var in1 = parseInt(index1)-1;
	$(obj).children().eq(0).children().eq(0).attr("src",menu_img_url2[in1]);
	$(obj).children().eq(1).css("color","#faac14");
}
/*返回顶部js*/
$(document).scroll(function(e) {
	if($(document).scrollTop()>400){
        $(".back").show();
    }else{
    	$(".back").hide();
    }
});

